# name : surv.consist.hr.fun
# key: surv.hr.consist.fun
# key: surv.consist.hr.fun
# contributor: Shuguang Sun
# --
${1:hrconst} <- function(x) {
  bd <- 1 - (1 - x$hr) * x$perc
  event <- (qnorm(x$prob) / (log(x$hr) - log(bd)) * (1 + x$r))^2 / x$r
  event
}
$1(x)